const express = require('express')
const router = express.Router();
const db = require('../../utils/db')

module.exports = router

router.get('/getdata', function(req, res, next) {
    let mysql = `SELECT menu_name,menu_price,menu_amount,menu_size ,menu_id,menu_num FROM menu_file;`
    db(mysql, null, function(err, data) {
        if (err) {
            return res.json({
                code: 500,
                msg: '加载数据失败'
            })
        }
        res.json({
            code: 200,
            msg: "加载数据成功",
            data: data
        })
    })
})